In modern microprocessors, memory access operations from different applications and the operating system are treated identically at the cache/memory side. When a cache or memory (or load-store queue in the processor) receives a memory access operation, it is unable to distinguish which thread or process has issued the memory request.
Difficult situations also arise when a cache is shared by many threads, or is in a multiprocessor environment. In such a situation, it is very important to be able to monitor cache behaviors for different threads or processes in order to more efficient manage those threads and processes. This is difficult or practically impossible if there is no way to tell which thread or process has issued a memory access request, such as in the cache/memory management systems of the prior art.
In addition to these issues concerning the anonymity of memory access requests in a cache, there are other problems that occur and cause deleterious effects on cache effectiveness and management. For example, false sharing can lead to cache thrashing. Cache thrashing occurs when two or more data items that are frequently needed by the program both map to the same cache address. Each time one of the items is encached, it overwrites another needed item, causing cache misses and impairing data reuse.
Cache efficiency can also be derailed by producer/consumer communication overhead. A producer process produces data which may be shared with other processes. A consumer process consumes the data produced (which may or may not change the data.) If these data associated with these processes are mapped to different caches, there is a lot of overhead that reduces the efficiency of communication. Further, if the consumer processes changes the data, invalidate lines in different caches and ensuring quality-of-service becomes a more difficult and time-consuming process.
Another process which reduces cache efficiency and increases unnecessary cache coherence overhead is cache pollution. Cache pollution refers to loading data into the cache that will not be reused before it is evicted. For example, this could occur when data from a streaming data access pattern is cached. This data would not be reused, and would thus pollute the cache line until it is removed.
Color-based cache monitoring allows each cache line to have a color and monitors various cache behaviors based on colors. In multiprocessor systems, improper thread placement can cause unnecessary cache coherence overhead. Color-based cache monitoring provides valuable runtime information that can be used by an Operating System to make thread scheduling and migration decisions to reduce producer/consumer communication overhead and/or cache thrashing due to false sharing.